<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arr = [2,4,5,8,7]
    let res = arr.reduce((t,c) => {
      return t+c
    }) 
    console.log(res)

    let list = [
        { id: 21, subject: '语文', score: 90 },
        { id: 32, subject: '数学', score: 100 },
        { id: 35, subject: '艺术', score: 100 }
    ]
    let res1 = list.reduce((t,c)=>{
      return t+c.score
    },0)
    console.log(res1)
  </script>
</body>
</html>